// pages/mystrategy/mystrategy.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    test: [
      {
        name: '专家一', tian: '15', money: '2000', back: '-7.65', rise: '9.35%',
        around: '90', end: '2018-08-13', price: '500', all: '120.53', ty: 1
      },
      {
        name: '交易专家二', tian: '160', money: '3000', back: '-19.77', rise: '7.26%',
        around: '180', end: '2018-07-22', price: '600', all: '920.26', ty: 1
      },
      {
        name: '小龙人', tian: '9', money: '3500', back: '-16.45', rise: '11.33%',
        around: '60', end: '2016-09-17', price: '700', all: '1250.50', ty: 2
      },
      {
        name: '马格南', tian: '78', money: '4000', back: '-20.08', rise: '19.24%',
        around: '120', end: '2018-05-30', price: '800', all: '1000.66', ty: 1
      },
      {
        name: '李青', tian: '15', money: '2000', back: '-7.65', rise: '9.35%',
        around: '90', end: '2018-08-13', price: '500', all: '120.53', ty: 2
      },
      {
        name: '诺克萨斯', tian: '160', money: '3000', back: '-19.77', rise: '7.26%',
        around: '180', end: '2018-07-22', price: '600', all: '920.26', ty: 1
      },
      {
        name: 'WunfjgTar', tian: '9', money: '3500', back: '-16.45', rise: '11.33%',
        around: '60', end: '2016-09-17', price: '700', all: '1250.50', ty: 1
      },
      {
        name: '郭哲宇', tian: '78', money: '4000', back: '-20.08', rise: '19.24%',
        around: '120', end: '2018-05-30', price: '800', all: '1000.66', ty: 2
      },
    ],
    current: 0,
    notwarning: true,
    touxiangurl: '../../image/qxtx/xuni.png',
  },

  /**
 * 生命周期函数--监听页面显示
 */
  onShow: function () {
    var that = this;
    that.setData({
      touxiangurl: getApp().globalData.userInfo.avatarUrl,
      // touxiangurl: '../../image/qxtx/jyzj.png',
    })
  },

  showdetail: function (e) {
    var that = this;
    var index = e.currentTarget.dataset.index;
    var list = that.data.test;
    list[index].show = !list[index].show;
    that.setData({
      test: list
    })
  },
  cancelfocus:function(e){
    var that = this;
    var index = e.currentTarget.dataset.index;
    // var list = that.data.test;
    // list[index].show = !list[index].show;
    // that.setData({
    //   test: list
    // })
    wx.showToast({
      icon: 'none',
      title: '取消成功',
    })
  },
  changeSwi: function (e) {
    var that = this;
    that.setData({
      current: parseInt(e.currentTarget.id)
    })
  },
  changecurrent: function (e) {
    var that = this;
    that.setData({
      current: e.detail.current
    })
  },

  closeWarning: function () {
    var that = this;
    that.setData({
      notwarning: false
    })
  },
  sure: function () {
    var that = this;
    that.setData({
      notwarning: true
    })
    wx.showToast({
      icon: 'success',
      title: '关闭成功',
    })
  },
  notsure: function () {
    var that = this;
    that.setData({
      notwarning: true
    })
  },
})